<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>米尔豪斯酒店后台管理系统</title>
    <link rel="stylesheet" type="text/css" href="../../css/consult_editor.css">

    <script type="text/javascript" language="javascript">
        function confirmAct() {
            if (confirm('确定要退出登陆吗?') == true) {
                window.location.href = "../../html/admin_login.html";
            }
        }
    </script>
</head>
<body>
<div class="all">
    <div class="all1">
        <h1>米尔豪斯酒店后台管理系统</h1>
    </div>

    <?php include '../menu.php'?>

    <div class="all3">
        <div class="guide">
            <p><img src="../../img/主页.png">&nbsp;&nbsp;当前位置 ： 后台管理 > 菜品管理 > 编辑</p>
        </div>
        <div class="change">
            <?php
            session_start();
            header("Content-type:text/html;charset=utf-8");
            $gid = $_GET['gid'];
            include "../../../lib/DB.php";
            include "../../../lib/Pagination.php";
            $db = new DB();
            $row = $db->table('goods')->where(['gid' => $gid])->find();
            $cat = $db->table('classification')->select();
            ?>

            <form action="goodsAction.php" method="post" enctype="multipart/form-data">
                <p>
                    <span>菜品名称&nbsp;&nbsp;&nbsp;&nbsp;：&nbsp;</span><input type="text" name="goods_name" id="name"
                                                                           value="<?php echo $row['goods_name'] ?>"
                                                                           class="change1">
                </p>
                <p><span>菜品价格&nbsp;：&nbsp;</span><input type="text" name="price" id="price"
                                                        value="<?php echo $row['price'] ?>" class="change1"></p>
                <p><span>菜品图片&nbsp;：&nbsp;</span>
                    <img width="100" height="100" src="<?php echo $row['goods_url']?>">
                    <input type="file" name="goods_url" >
                </p>
                <p><span>菜品分类&nbsp;：&nbsp;</span>

                    <select name="c_id">
                        <option value="0">请选择菜品分类</option>
                        <?php foreach ($cat as $vv):?>
                        <option value="<?php echo $vv['cid']?>" <?php if($vv['cid'] == $row['c_id']){ echo "selected";}?>><?php echo $vv['cname']?></option>
                        <?php endforeach;?>
                    </select>
                </p>
                <p><span>是否热卖&nbsp;：&nbsp;</span>
                    <label><input name="is_hot" type="radio" value="1"  <?php if($row['is_hot'] == 1){echo "checked";}?>/>是 </label>
                    <label><input name="is_hot" type="radio" value="2" <?php if($row['is_hot'] == 2){echo "checked";}?>/>否 </label>
                </p>
                <input type="submit" name="change" value="修改" class="sublime">
                <input type="hidden" name="act" value="edit" class="sublime">
                <input type="hidden" name="gid" value="<?php echo $row['gid']?>" class="sublime">
            </form>
        </div>
    </div>
    <div class="all4">
        <h3>米尔豪斯酒店</h3>
    </div>
</div>
</body>
</html>